﻿using System;
using System.Collections.Generic;
#if DEBUG
using System.Diagnostics;
#endif // #if DEBUG
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using FRL.DebtChased.Repository;
using FRL.DebtChased.Website;

namespace WebApplication.Finance
{

	/// <summary>
	/// Declaration of ClientBankAccounts
	/// </summary>
	public partial class ClientBankAccounts : System.Web.UI.Page
	{

		/////////////////////////////////////////////////////////////
		// Event handlers

		protected void Page_Load(object sender, EventArgs e)
		{

			// If this is a postback...
			if (this.IsPostBack)
			{

			}
			else
			{

				// Get the context client id
				MySession mySession = MySession.BindMySession();
				int iClientId = mySession.ContextClientId;
				if (iClientId == 0)
				{
					Response.Redirect("~/Finance/Clients.aspx");
					return;
				}

				// Declare an entities object
				using (DebtChasedEntities ent = new DebtChasedEntities())
				{

					// Get the client name
					string strClient = Client.GetName(ent, iClientId);

					// Set the bar title
					clientHeadingBarCtrl.BarTitle = string.Format("{0} - Bank Accounts", strClient);

				}

			}

		}

		protected void butRevert_Click( object sender, EventArgs e )
		{

			// Reload the page
			this.Reload();

		}

		protected void butSave_Click( object sender, EventArgs e )
		{

			// Reload the page
			this.Reload();

		}

	}

}